﻿using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TookKit.Mvvm.Interfaces
{
    /// <summary>
    /// 模块管理器的接口
    /// </summary>
    public interface IModuleManager
    {
        /// <summary>
        /// 模块目录
        /// </summary>
        string ModuleCatalog { get; set; }

        /// <summary>
        /// 模块类的映射字典
        /// </summary>
        ConcurrentDictionary<string,Type> ModuleMaps { get; }
        /// <summary>
        /// 模块实例集合
        /// </summary>
        ConcurrentDictionary<string,object> Instances { get; }

        /// <summary>
        /// 注册模块
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        IModuleManager AddModule<T>();
        /// <summary>
        /// 注册模块
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        IModuleManager AddModule(Type moduleType);
        /// <summary>
        /// 初始化模块
        /// </summary>
        /// <returns></returns>
        IModuleManager InitializeModules();
    }
}
